
<include file="Public/_meta" />
<title>用户管理</title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页 
    <span class="c-gray en">&gt;</span> 权限管理
    <span class="c-gray en">&gt;</span> 管理员列表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<div class="pd-20">

    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <a href="javascript:;" onclick="member_add('添加用户','{:U(admin_info)}','','')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加用户</a></span>
        <span class="r">共有数据：<strong><{$count}></strong> 条</span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg table-sort">
        <thead>
            <tr class="text-c">
                <th>用户名</th>
                <th>所属角色</th>
                <th>描述</th>
                <th>加入时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <volist name="list" id='vo' empty="$empty">
                <tr class="text-c">   
                    <td>{$vo['username']}</td>
                    <td>{$vo['role_name']}</td>
                    <td>{$vo['remark']}</td>
                    <td>{$vo['reg_time']|date="Y-m-d H:i:s",###}</td>
                    <td class="f-14 user-manage">
                    <a title="编辑" href="javascript:;" onclick="member_edit('账号编辑','{:U(admin_info)}','{$vo[id]}')" class="ml-5" style="text-decoration:none">
                    <span><i class="Hui-iconfont">&#xe6df;</i> 编辑</span>
                    </a>
                    <a title="删除" href="javascript:;" onclick="member_del(this)" data-id="{$vo['id']}" class="ml-5" style="text-decoration:none">
                    <span><i class="Hui-iconfont">&#xe6e2;</i> 删除</span>
                    </a>
                    </td>
                </tr>
            </volist>
        </tbody>
    </table>
    <div id="pageNav" class="pageNav">共有<i class="blue">{$count}</i>条记录，当前显示<i class="blue">{$p}</i>页，共计<i class="blue">{$totalPages|default=0}</i>页{$show}</div>
</div>

<!--_footer 作为公共模版分离出去-->
<include file="Public/_footer" />
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->

<script type="text/javascript">
/*用户-添加*/
function member_add(title,url,w,h){
    var index = layer.open({
        type: 2,
        title: title,
        content: url
    });

    layer.full(index);
}

/*用户-编辑*/
function member_edit(title,url,id,w,h){
  var index = layer.open({
    type: 2,
    title: title,
    content: url + '?id='+id
  });

  layer.full(index);
}


/*用户-停用*/
function member_del(obj){
    var load;
    var id = $(obj).data('id');
    layer.confirm('确认要删除吗？',function(index){
        $.ajax({
            type: 'post',
            url: '/admin/admin/adminHandle',
            data:{admin_id:id, act: 'del'},
            dataType: 'json',
            beforeSend:function(){
                load = layer.load(1)
            },
            success: function(res){
                if(res.status == 0)
                {
                    layer.msg(res.message,{icon:1,time:2000},function(){
                        location.reload();
                    })
                }
                else
                {
                    layer.msg(res.message,{icon:2,time:2000})
                }
            },
            error:function(data) {
                layer.alert("网络错误，请稍后重试！");
            },
            complete:function(){
                layer.close(load);
            }
        });   
    });
}

</script>
</body>
</html>
